﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace SaleService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging.
    public class Service1 : IService1
    {
        public string GetData(int kAVIEDES)
        {
            return string.Format("You entered: {0}", kAVIEDES);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }
        public List<Customer> GetCustomers()
        {
            DataLayerDataContext dc = new DataLayerDataContext();
            
            return customers.ToList();
        }
		public List<Customer> GetCustomersByCategoryID(int)
		{
		return new //list of customers;
		}
        public List<Customer> GetCustomers(string FirstName)
        {
            DataLayerDataContext dc = new DataLayerDataContext();
            var customers = from c in dc.Customers where c.FirstName.Contains(FirstName) select c;
            return customers.ToList();
        }

    }
}
